Method, system and apparatus for low-power storage of processor context information

ABSTRACT

A method and system for saving and/or retrieving context information of a processor core for a power state transition. The processor core resides in a complex power domain variously transitioning between a plurality of power states. The processor core includes a local context storage area for storage and retrieval of processor core context information. A low power context storage resides in a nominal power domain external to the complex power domain. Context information of the processor core is stored to the low power context storage based on whether a power state transition of the complex power domain includes a transition to power down the processor core.

BACKGROUND

1. Technical Field

Embodiments of the present invention relate generally to dataprocessing. More particularly, embodiments relate to techniques forsaving and/or retrieving context information of a processor core for apower state transition associated with the processor core.

2. Background Art

Processor devices on high-availability platforms, such as those used forMobile Internet Device (MID) applications, must support “always-on”modes of operation. Always on modes of operation are generallycharacterized by low latency entry to and/or exit from very low powerstates on the platform while maintaining an operating system (OS)context and external connectivity. In order to reach very low powerstates from a platform perspective, most processor device blocks aretypically powered off and state is typically retained either in hardware(HW) or by software (SW) interaction. Such processor device blocks caninclude one or more cores of a processor—e.g. a central processing unit(CPU) on the platform.

CPU context information is often retained in CPU cache—e.g. a L2 cacheof a processor core which is dedicated to operate as a context storageSRAM. However, leakage associated with such volatile local CPU storageoften makes it infeasible to retain this state during low power modes.However, not retaining CPU context information in HW has an adverseeffect on exit from these low power states. Alternatives to HW typicallyrequire SW to save and restore architectural and/or micro-architecturalstate, which increases exit latency. Since processor core staterestoration operates at a much higher power level than standby, anincrease of 1 ms in serialized exit latency can decrease battery life,e.g. by ˜8%, in some circumstances.

BRIEF DESCRIPTION OF THE DRAWINGS

The various embodiments of the present invention are illustrated by wayof example, and not by way of limitation, in the figures of theaccompanying drawings and in which:

FIG. 1 is a block diagram illustrating select elements of a system toaccess processor context information according to an embodiment.

FIG. 2 is a sequence diagram illustrating select elements of a methodfor storing processor context information according to an embodiment.

FIG. 3 is a sequence diagram illustrating select elements of a method toretrieving processor context information according to an embodiment.

FIG. 4 is a block diagram illustrating select elements of a system toaccess processor context information according to an embodiment.

FIG. 5A is a sequence diagram illustrating select elements of a methodfor storing processor context information according to an embodiment.

FIG. 5B is a sequence diagram illustrating select elements of a methodfor storing processor context information according to an embodiment.

FIG. 6 is a sequence diagram illustrating select elements of a methodfor retrieving processor context information according to an embodiment.

DETAILED DESCRIPTION

FIG. 1 illustrates select elements of a system 100 to store processorcontext information according to an embodiment. System 100 may include aprocessing device, such as a CPU, having at least one processor core120. The processor core 120 may reside in a complex power domain110—i.e. a group of one or more hardware components and/or devicescapable of variously operating in different power states. As usedherein, “power state” refers to a condition of a power domain forachieving a performance which exhibits a particular powercharacteristic—e.g. one or more levels and/or types of powerconsumption. In an embodiment, a plurality of power states of complexpower domain 110 may include providing various respective supply voltagelevels to processor core 120.

The plurality of power states of complex power domain 110 may includesuccessive power states whereby power consumption by processor core 120may be incrementally increased/reduced. For example, hardware devicesand/or components communicating with processor core 120 from withincomplex power domain 110 may be successively turned off or otherwisepowered down—e.g. to incrementally reduce the processing load onprocessor core 120. Alternatively or in addition, some or all of thecircuit logic within processor core 120 may be selectively turned off orotherwise powered down to reduce power consumption. In an embodiment, arelatively lower power consumption state of a plurality of power statesin complex power domain 110 may represent a standby mode in whichprocessing core 120 is completely powered down.

In an embodiment, system 100 may include a nominal power domain 140separate from complex power domain 110. Nominal power domain 140 mayinclude its own power state demonstrating some power characteristicwhich is consistent during various power states of one or more otherpower domains in system 100. For example, a low power (LP) contextstorage 142 in nominal power state 140 may be provided with or otherwisemaintain at least some minimal supply voltage level or levels during aplurality of power states of complex power domain 110. In an embodiment,the power state of nominal power domain 140 may be a precondition for aplurality of various power states of complex power domain 110.

By providing a consistent power characteristic, a power state of nominalpower domain 140 may support an “always-on” mode of operation in system100. For example, LP context storage 142 of nominal power domain 140 maybe kept powered on and available in order to support another domain—e.g.complex power domain 110—as it variously transitions into and/or out ofits respective power states. More particularly, LP context storage 142may be kept available for the storing and/or recovering contextinformation for processor core 120. As used herein, “contextinformation” refers to information describing a state of operation at aparticular time. Context information may represent all, or only aportion of, the state (or context) of a data processing system. Forexample, context information of processor core 120 may describe one ormore conditions of processor core 120—e.g. at a time just before itentered a particular power state.

Processor core 120 may use its own context storage code 122 to direct astoring of certain of its context information in a local context storage124. Moreover, context information of processor core 120 may be storedremotely in low power (LP) context storage 142. LP context storage 142be may considered “low power” at least insofar as storage of contextinformation in LP context storage 142 provides a relative power savingadvantage over some alternative which maintains a level of power toprocessing core 120 for the purpose of preserving context stored inlocal context storage 124. A controller 130 in complex power domain 110may assist context storage code 122 in accessing LP context storage 142to store and/or retrieve context information for power state transitionswhich are associated with processor core 120 being powered down.

Saving and/or retrieving context information of processor core 120 mayinclude accessing a local context storage 124 within processor core 120.In an embodiment, saving and/or retrieving context information ofprocessor core 120 may be at least partially directed by a controller130 of system 110. For example, controller 130 may providecommunications to context storage code 122 indicating when contextinformation of processor core 120 is to be saved to and/or retrievedfrom LP context storage 142 of the nominal power domain 140.

FIG. 2 illustrates select elements of a method 200 for saving processorcontext information, according to an embodiment. Method 200 may beperformed by system 100, for example. Method 200 may include detecting,at 210, an indication of a power state transition. For example, powermanagement hardware and/or software of system 100 (not shown) may detecta drop in a processing load, a loss of an access point to a networkand/or some other event indicating that system 100 can avail of anopportunity to decrease power consumption. Alternatively or in addition,context storage code 122 may detect a trigger message based on such anevent being detected, the message directing the context storage code 122to initiate a storing of processor context information.

In response to detecting the indication, a determination may be made, at220, as to whether the power state transition which is indicatedincludes a transition to a particular power state P_(N) of the pluralityof power states. For example, context storage code 122 and/or controller130 may query power management means of system 100 to identify whether(or not) complex power domain 110 is to transition to power state P_(N).In an embodiment, power state P_(N) includes a state in which aprocessor core—e.g. processor core 120—is powered down.

If a determination is made that the power state transition does includethe transition to power state P_(N), then certain processor contextinformation may be saved in a first context storage. The first contextstorage may include, for example, LP context storage 142. In anembodiment, context information of processor core 120 may be storeddirectly to LP context storage 142. Alternatively, context informationof processor core 120 may first be stored to local context storage 124and then copied from local context storage 124 to LP context storage142. Initially storing context information to local context storage 124before copying to LP context storage 142 may reduce the need to maintaindistinct yet functionally duplicative messaging and/or instructions forcorresponding context storage operations.

If a determination is made that the power state transition does notinclude the transition to power state P_(N), then the processor contextinformation may be saved in a second context storage, at 235. In anembodiment, this second context storage may be the local context storage124. It is understood that an alternative result (not shown) of thedetermining at 220 may be that no context information needs to bestored. After any storing of processor context information is done,system 100 may continue, at 240, as necessary to complete the powerstate transition.

FIG. 3 illustrates select elements of a method 300 for retrievingprocessor context information, according to an embodiment. Method 300may be performed by system 100, for example. Method 300 may includedetecting, at 310, an indication of a power state transition. Forexample, power management hardware and/or software of system 100 (notshown) may detect an actual or expected increase in a processing load, anewly available network access point and/or some other event indicatingthat system 100 may be required to increase power consumption.Alternatively or in addition, context storage code 122 may detect atrigger message based on such an event being detected, the messagedirecting the context storage code 122 to initiate a retrieval of storedprocessor context information.

In response to detecting the indication, a determination may be made, at320, as to whether the power state transition which is indicatedincludes a transition from a particular power state P_(N) of theplurality of power states. For example, context storage code 122 and/orcontroller 130 may query power management means of system 100 toidentify whether (or not) complex power domain 110 is to transition frompower state P_(N). In an embodiment, power state P_(N) may include astate in which a processor core is powered down.

If a determination is made that the power state transition does includethe transition from power state P_(N), then processor contextinformation may be retrieved from a first context storage, at 330. Thefirst context storage may include, for example, LP context storage 142.In an embodiment, context information of processor core 120 may beretrieved directly from LP context storage 142. Alternatively, contextinformation of processor core 120 may first be copied to local contextstorage 124 from LP context storage 142 before processor state isrestored based on the context information copied to local contextstorage 124.

If a determination is made that the power state transition does notinclude the transition to power state P_(N), then the processor contextinformation may be retrieved from a second context storage, at 335. Inan embodiment, this second context storage may be the local contextstorage 124. It is understood that an alternative result (not shown) ofthe determining at 320 may be that no context information needs to beretrieved. After the storage of the processor context is done, at 340,system 100 may continue as necessary to complete the power statetransition.

FIG. 4 illustrates select elements of a system 400 to store processorcontext information according to an embodiment. System 400 may includeat least some features discussed herein with respect to system 100.System 400 may implement a plurality of power states within a complexpower domain 410 which includes a processing device having at least oneprocessor core 420. Processor core 420 may include microcode (μCode) 422to store certain context information of processor core 424 to a localcontext storage—e.g. local SRAM 424. System 400 may further includemicro-firmware (μFW) 430—e.g. external to processor core 430—to providecontrol instructions which augment the context saving capabilities ofμCode 422.

The complex power domain 410 may be distinguished from a nominal powerdomain 440 of system 400. The nominal power domain 440 may include oneor more hardware devices and/or components which are provided with orotherwise maintain some consistent power characteristic during each of aplurality of power states in the complex power domain 410. By way ofillustration and not limitation, a low power SRAM 442 of nominal powerdomain 440 may be provided with at least some minimal voltage supplylevel as a condition for complex power domain 410 to implement and/orvariously transition between a plurality of power states. The at leastminimal power supply maintains an availability of low power SRAM 442 tostore context information of processor core 420—e.g. for transitions ofcomplex power domain 410 into and/or out of a power state in whichprocessor core 420 is completely powered down.

System 400 may provide selective storing of context information forprocessor core 420 to local SRAM 424 and/or low power SRAM 442, wherethe destination(s) to which the context information is stored isdetermined based at least in part on identifying a power state to which(or from which) complex power domain 410 is transitioning. System 400may store information—e.g. in an implementation-specific register (ISR)435—indicating that context information of processor core 420 is to bestored—or has been stored—in a particular combination of local SRAM 424and/or low power SRAM 442. The μFW 430 may access ISR 435 to determinewhether or how context storing or retrieving by μCode 422 is to accountfor a storing of context in low power SRAM 440.

FIG. 5A illustrates select elements of a method 500 to store processorcontext information according to an embodiment. In various embodiments,method 500 may be performed in a system including features of system 100and/or system 400. In method 500, a power management (PM) event may beidentified, at 505, as being a trigger for a power state transition. Inresponse to the identifying the PM event, a determination may be made,at 510, as to whether the triggered power state transition includestransitioning to a power state in which a processor core is powereddown. The processor core may reside in a complex power domainimplementing a plurality of power states including at least one powerstate in which the processor core is powered down. The complex powerdomain of the processor core may be distinguished from a nominal powerdomain in which a low power (LP) RAM is kept available to store contextinformation of the processor core.

If it is determined that the triggered power state transition is topower down the processor core, then information may be stored, at 515,indicating a storing of context information for the processor core inthe LP RAM. In an embodiment, an ISR or similar data storage means willstore such information to serve as a trigger so that code responsiblefor storing such context information will branch to perform an executionflow which stores the context information to the LP RAM. In anembodiment, the storing of processor core context information to the LPRAM may include storing the processor core context information to alocal RAM of the processor core and then offloading a copy of the storedcontext information from the local RAM to the LP RAM of the nominalpower domain. It is understood that in various alternate embodiments,the processor core context information may be save directly saved to theLP RAM—e.g. without accessing the local RAM of the processor core.

If the triggered power state transition is determined to not power downthe processor core, the storing of trigger information in 515 may bebypassed, and method 500 may continue with other operations, at 520, toprepare one or more execution threads for a powering down of theprocessor core. In various embodiments, context information may includeinformation describing the state of one or more threads running on aprocessor core.

FIG. 5B illustrates select elements of a method 550 to store processorcontext information according to an embodiment. Method 550 may beperformed in a system including features discussed herein with respectto system 100 and system 400, for example. In an embodiment, method 550may be performed after operations of method 500. At 555, context storingcode such as μCode 422 may save processor context information—e.g. acurrent state of one or more threads executing in a processor core—to alocal RAM of that processor core. The processor core may reside in acomplex power domain implementing a plurality of power states includingat least one power state in which the processor core is powered down.The complex power domain of the processor core may be distinguished froma nominal power domain in which a low power (LP) RAM is kept availableto store context information of the processor core.

An evaluation may be made at 560—e.g. by the μCode of the processor coreor by external control code supporting the μCode—as to whether (or not)an ISR or similar repository indicates that the stored processor contextinformation is to be offloaded from local RAM. If so, then the μCodeoffloads the thread state(s) or other processor context information tothe LP RAM, at 565. If offloading from the local RAM is not indicated,then the μCode foregoes writing the context information to the LP RAM,and continues with other operations to complete the power down of theprocessor core.

FIG. 6 illustrates select elements of a method 600 for retrievingprocessor context information according to an embodiment. Method 600 maybe performed in a system including features discussed herein withrespect to system 100 and system 400, for example. In an embodiment,method 600 is to retrieve context information stored by either or bothof methods 500 and 550.

At 605, controller means such as μFW may identify an event as a triggerfor a power state transition. In response to the identifying the event,a determination may be made, at 610, as to whether the triggered powerstate transition includes awaking from a power state in which aprocessor core is powered down. The processor core may reside in acomplex power domain implementing a plurality of power states. Thecomplex power domain of the processor core may be distinguished from anominal power domain in which a low power (LP) RAM is kept available tostore context information of the processor core.

If it is determined that the power state transition is to awaken theprocessor core from being powered down, then at 615, controlling codesuch as μFW may notify context storage μCode of the processor core tocopy the thread state(s) or other processor context information from theLP RAM to a local RAM of the processor core. After the processor contextinformation is copied to the local RAM, the μFW may direct a deleting ofthe processor context information from the LP RAM, at 620. The μCode mayrestore the state of thread(s) in the processor core from the contextinformation copied to local RAM, at 620. If it is determined that thepower state transition is not to awaken the processor core from beingpowered down, then the restoring of thread state at 620 may be performedwithout the accessing of the LP RAM at 615 or 620.

Techniques and architectures for processor operation are describedherein. In the above description, for purposes of explanation, numerousspecific details are set forth in order to provide a thoroughunderstanding of embodiments of the invention. It will be apparent,however, to one skilled in the art that embodiments of the invention canbe practiced without these specific details. In other instances,structures and devices are shown in block diagram form in order to avoidobscuring the description.

Reference in the specification to “one embodiment” or “an embodiment”means that a particular feature, structure, or characteristic describedin connection with the embodiment is included in at least one embodimentof the invention. The appearances of the phrase “in one embodiment” invarious places in the specification are not necessarily all referring tothe same embodiment.

Some portions of the detailed descriptions herein are presented in termsof algorithms and symbolic representations of operations on data bitswithin a computer memory. These algorithmic descriptions andrepresentations are the means used by those skilled in the dataprocessing arts to most effectively convey the substance of their workto others skilled in the art. An algorithm is here, and generally,conceived to be a self-consistent sequence of steps leading to a desiredresult. The steps are those requiring physical manipulations of physicalquantities. Usually, though not necessarily, these quantities take theform of electrical or magnetic signals capable of being stored,transferred, combined, compared, and otherwise manipulated. It hasproven convenient at times, principally for reasons of common usage, torefer to these signals as bits, values, elements, symbols, characters,terms, numbers, or the like.

It should be borne in mind, however, that all of these and similar termsare to be associated with the appropriate physical quantities and aremerely convenient labels applied to these quantities. Unlessspecifically stated otherwise as apparent from the following discussion,it is appreciated that throughout the description, discussions utilizingterms such as “processing” or “computing” or “calculating” or“determining” or “displaying” or the like, refer to the action andprocesses of a computer system, or similar electronic computing device,that manipulates and transforms data represented as physical(electronic) quantities within the computer system's registers andmemories into other data similarly represented as physical quantitieswithin the computer system memories or registers or other suchinformation storage, transmission or display devices.

The present invention also relates to apparatus for performing theoperations herein. This apparatus may be specially constructed for therequired purposes, or it may comprise a general purpose computerselectively activated or reconfigured by a computer program stored inthe computer. Such a computer program may be stored in a computerreadable storage medium, such as, but is not limited to, any type ofdisk including floppy disks, optical disks, CD-ROMs, andmagnetic-optical disks, read-only memories (ROMs), random accessmemories (RAMs) such as dynamic RAM (DRAM), EPROMs, EEPROMs, magnetic oroptical cards, or any type of media suitable for storing electronicinstructions, and each coupled to a computer system bus.

The algorithms and displays presented herein are not inherently relatedto any particular computer or other apparatus. Various general purposesystems may be used with programs in accordance with the teachingsherein, or it may prove convenient to construct more specializedapparatus to perform the required method steps. The required structurefor a variety of these systems will appear from the description herein.In addition, the present invention is not described with reference toany particular programming language. It will be appreciated that avariety of programming languages may be used to implement the teachingsof embodiments of the invention as described herein.

Besides what is described herein, various modifications may be made tothe disclosed embodiments and implementations of the invention withoutdeparting from their scope. Therefore, the illustrations and examplesherein should be construed in an illustrative, and not a restrictivesense. The scope of embodiments of the invention should be measuredsolely by reference to the claims that follow.

1. A method comprising: detecting an indication of a first power statetransition of a first power domain including a processor core; inresponse to the detecting the indication of the first power statetransition, sending from the processor core to power management logic aquery for determining whether the first power state transition includesa transition to a first power state of a plurality of power states ofthe first power domain; and in response to determining that the firstpower state transition of the processor core is to include thetransition to the first power state, saving a context information of theprocessor core in a first context storage external to the first powerdomain, otherwise, saving the context information of the processor corein a second context storage within the processor core.
 2. The method ofclaim 1, wherein the first power state includes a state in which theprocessor core is powered down.
 3. The method of claim 1, wherein thefirst context storage and the second context storage include a staticrandom access memory (SRAM).
 4. The method of claim 1, wherein savingthe context information of the processor core in the first contextstorage includes: saving the context information of the processor coreto the second context storage, and copying the context information savedin the second context storage to the first context storage.
 5. Themethod of claim 1, wherein saving the context information of theprocessor core in the first context storage includes saving withoutaccessing the second context storage.
 6. The method of claim 1, whereinthe first context storage is in a second power domain separate from thefirst power domain, wherein a power state of the second power domainincludes a power characteristic maintained during each of the pluralityof power states of the first power domain.
 7. The method of claim 6,wherein the power characteristic includes the first context storagebeing provided at least a first supply voltage level.
 8. The method ofclaim 1, further comprising detecting an indication of a second powerstate transition of the first power domain, the second power statetransition subsequent to the first power state transition; in responseto the detecting the indication of the second power state transition,determining whether the second power state transition includes atransition from the first power state; and if the second power statetransition is determined to include the transition from the first powerstate, then retrieving the context information of the processor corefrom the first context storage, else if the second power statetransition is determined to not include the transition from the firstpower state, then retrieving the context information of the processorcore from the second context storage.
 9. A system comprising: aprocessor device including a processor core having a first contextstorage, the processor core to detect an indication of a power statetransition of a first power domain including the processor device, theprocessor core further to send a query from the processor core to powermanagement logic in response to the detecting the indication of thepower state transition, the query to determine whether the power statetransition includes a transition to a first power state of a pluralityof power states of the first power domain; and a second context storagedevice coupled to the processor device and external to the first powerdomain; wherein the processor core to save context information of theprocessor core in the second context storage in response to determiningthat the power state transition of the processor core includes thetransition to the first power state, otherwise, the processor core tosave the context information of the processor core in the first contextstorage.
 10. The system of claim 9, wherein the first power stateincludes a state in which the processor core is powered down.
 11. Thesystem of claim 9, wherein the first context storage and the secondcontext storage include a static random access memory (RAM).
 12. Thesystem of claim 9, wherein the processor core to save the contextinformation of the processor core in the second context storageincludes: the processor core to save the context information of theprocessor core to the first context storage, and the processor core tocopy the context information saved in the second context storage to thefirst context storage.
 13. The system of claim 9, wherein the secondcontext storage is in a second power domain separate from the firstpower domain, wherein a power state of the second power domain maintainsa power characteristic during each of the plurality of power statesplurality of power states of the first power domain.
 14. An apparatuscomprising: a processor core having a first context storage, theprocessor core to detect an indication of a power state transition of afirst power domain including the processor core, the processor corefurther to send a query from the processor core to power managementlogic in response to the detecting the indication of the power statetransition, the query to determine whether the power state transitionincludes a transition to a first power state of a plurality of powerstates of the first power domain; wherein a second context storage iscoupled to the processor core and external to the first power domain;wherein the processor core to save context information of the processorcore in the second context storage in response to determining that thepower state transition of the processor core includes the transition tothe first power state, otherwise, the processor core to save the contextinformation of the processor core in the first context storage.
 15. Theapparatus of claim 14, wherein the first power state includes a state inwhich the processor core is powered down.
 16. The apparatus of claim 14,wherein the first context storage and the second context storage includea static random access memory (RAM).
 17. The apparatus of claim 14,wherein the processor core to save the context information of theprocessor core in the second context storage includes: the processorcore to save the context information of the processor core to the firstcontext storage, and the processor core to copy the context informationsaved in the second context storage to the first context storage. 18.The apparatus of claim 14, wherein the second context storage is in asecond power domain separate from the first power domain, wherein apower state of the second power domain provides a power characteristicduring each of the plurality of power states plurality of power statesof the first power domain.